home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / ruby.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  21KB  |  589 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Archit Baweja <bighead@users.sourceforge.net>
  5.  Copyright (C) 2004 Archit Baweja <bighead@users.sourceforge.net>
  6.  Copyright (C) 2005 Michael Witrant <mike@lepton.fr>
  7.  Copyright (C) 2006 Gabriel Bauman <gbauman@gmail.com>
  8.  
  9.  This library is free software; you can redistribute it and/or modify
  10.  it under the terms of the GNU General Public License as published by
  11.  the Free Software Foundation; either version 2 of the License, or
  12.  (at your option) any later version.
  13.  
  14.  This program is distributed in the hope that it will be useful,
  15.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  GNU General Public License for more details.
  18.  
  19.  You should have received a copy of the GNU General Public License
  20.  along with this program; if not, write to the Free Software
  21.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22.  
  23. -->
  24. <language id="ruby" _name="Ruby" version="2.0" _section="Scripts">
  25.   <metadata>
  26.     <property name="mimetypes">application/x-ruby;text/x-ruby</property>
  27.     <property name="globs">*.rb</property>
  28.     <property name="line-comment-start">#</property>
  29.   </metadata>
  30.  
  31.   <styles>
  32.     <style id="escape"               _name="Escaped Character"      map-to="def:special-char"/>
  33.     <style id="comment"              _name="Comment"               map-to="def:comment"/>
  34.     <style id="attribute-definition" _name="Attribute Definition"  map-to="def:statement"/>
  35.     <style id="module-handler"       _name="Module handler"        map-to="def:preprocessor"/>
  36.     <style id="keyword"              _name="Keyword"               map-to="def:keyword"/>
  37.     <style id="nil-value"            _name="Nil Constant"          map-to="def:special-constant"/>
  38.     <style id="boolean"              _name="Boolean value"         map-to="def:boolean"/>
  39.     <style id="floating-point"       _name="Floating point number" map-to="def:floating-point"/>
  40.     <style id="decimal"              _name="Decimal number"        map-to="def:decimal"/>
  41.     <style id="base-n-integer"       _name="Base-N number"         map-to="def:base-n-integer"/>
  42.     <style id="numeric-literal"      _name="Numeric literal"       map-to="def:base-n-integer"/>
  43.     <style id="string"               _name="String"                map-to="def:string"/>
  44.     <style id="builtin"              _name="Builtin"               map-to="def:type"/>
  45.     <style id="constant"             _name="Constant"              map-to="def:type"/>
  46.     <style id="symbol"               _name="Symbol"                map-to="def:string"/>
  47.     <style id="special-variable"     _name="Special Variable"      map-to="def:identifier"/>
  48.     <style id="predefined-variable"  _name="Predefined Variable"   map-to="def:identifier"/>
  49.     <style id="variable"             _name="Variable"              map-to="def:identifier"/>
  50.     <style id="here-doc"             _name="Heredoc"               map-to="def:string" />
  51.     <style id="here-doc-bound"       _name="Heredoc Bound"         map-to="def:string"/>
  52.     <style id="regex"                _name="Regular Expression"    map-to="def:identifier"/>
  53.   </styles>
  54.  
  55.   <definitions>
  56.  
  57.     <context id="escape" style-ref="escape">
  58.       <match>\\((0-7){3}|(x[a-fA-F0-9]{2})|(c\S)|([CM]-\S)|(M-C-\S)|.)</match>
  59.     </context>
  60.  
  61.     <context id="multiline-comment" style-ref="comment">
  62.       <start>^=begin</start>
  63.       <end>^=end</end>
  64.       <include>
  65.         <context ref="escape"/>
  66.         <context ref="def:in-comment"/>
  67.       </include>
  68.     </context>
  69.  
  70.     <context id="attribute-definitions" style-ref="attribute-definition">
  71.       <keyword>attr</keyword>
  72.       <keyword>attr_writer</keyword>
  73.       <keyword>attr_reader</keyword>
  74.       <keyword>attr_accessor</keyword>
  75.     </context>
  76.  
  77.     <context id="definitions" style-ref="keyword">
  78.       <!-- do not highlight the .class method -->
  79.       <prefix>(?<![\w\.])</prefix>
  80.       <keyword>alias</keyword>
  81.       <keyword>class</keyword>
  82.       <keyword>module</keyword>
  83.       <keyword>def</keyword>
  84.       <keyword>undef</keyword>
  85.     </context>
  86.  
  87.     <context id="module-handlers" style-ref="module-handler">
  88.       <keyword>require</keyword>
  89.       <keyword>include</keyword>
  90.       <keyword>load</keyword>
  91.     </context>
  92.  
  93.     <context id="keywords" style-ref="keyword">
  94.       <keyword>BEGIN</keyword>
  95.       <keyword>END</keyword>
  96.       <keyword>and</keyword>
  97.       <keyword>begin</keyword>
  98.       <keyword>break</keyword>
  99.       <keyword>case</keyword>
  100.       <keyword>catch</keyword>
  101.       <keyword>defined?</keyword>
  102.       <keyword>do</keyword>
  103.       <keyword>else</keyword>
  104.       <keyword>elsif</keyword>
  105.       <keyword>end</keyword>
  106.       <keyword>ensure</keyword>
  107.       <keyword>for</keyword>
  108.       <keyword>if</keyword>
  109.       <keyword>in</keyword>
  110.       <keyword>next</keyword>
  111.       <keyword>not</keyword>
  112.       <keyword>or</keyword>
  113.       <keyword>private</keyword>
  114.       <keyword>protected</keyword>
  115.       <keyword>public</keyword>
  116.       <keyword>redo</keyword>
  117.       <keyword>rescue</keyword>
  118.       <keyword>retry</keyword>
  119.       <keyword>return</keyword>
  120.       <keyword>then</keyword>
  121.       <keyword>throw</keyword>
  122.       <keyword>unless</keyword>
  123.       <keyword>until</keyword>
  124.       <keyword>when</keyword>
  125.       <keyword>while</keyword>
  126.       <keyword>yield</keyword>
  127.     </context>
  128.  
  129.     <context id="builtins" style-ref="builtin">
  130.       <keyword>ARGF</keyword>
  131.       <keyword>ARGV</keyword>
  132.       <keyword>Abbrev</keyword>
  133.       <keyword>ArgumentError</keyword>
  134.       <keyword>Array</keyword>
  135.       <keyword>Base64</keyword>
  136.       <keyword>Benchmark::Tms</keyword>
  137.       <keyword>Benchmark</keyword>
  138.       <keyword>Bignum</keyword>
  139.       <keyword>Binding</keyword>
  140.       <keyword>CGI::Cookie</keyword>
  141.       <keyword>CGI::HtmlExtension</keyword>
  142.       <keyword>CGI::QueryExtension</keyword>
  143.       <keyword>CGI::Session::FileStore</keyword>
  144.       <keyword>CGI::Session::MemoryStore</keyword>
  145.       <keyword>CGI::Session</keyword>
  146.       <keyword>CGI</keyword>
  147.       <keyword>Class</keyword>
  148.       <keyword>Comparable</keyword>
  149.       <keyword>Complex</keyword>
  150.       <keyword>ConditionVariable</keyword>
  151.       <keyword>Continuation</keyword>
  152.       <keyword>DATA</keyword>
  153.       <keyword>Data</keyword>
  154.       <keyword>Date</keyword>
  155.       <keyword>DateTime</keyword>
  156.       <keyword>Delegator</keyword>
  157.       <keyword>Dir</keyword>
  158.       <keyword>ENV</keyword>
  159.       <keyword>EOFError</keyword>
  160.       <keyword>ERB::Util</keyword>
  161.       <keyword>ERB</keyword>
  162.       <keyword>Enumerable::Enumerator</keyword>
  163.       <keyword>Enumerable</keyword>
  164.       <keyword>Errno</keyword>
  165.       <keyword>Exception</keyword>
  166.       <keyword>FalseClass</keyword>
  167.       <keyword>File::Constants</keyword>
  168.       <keyword>File::Stat</keyword>
  169.       <keyword>File</keyword>
  170.       <keyword>FileTest</keyword>
  171.       <keyword>FileUtils::DryRun</keyword>
  172.       <keyword>FileUtils::NoWrite</keyword>
  173.       <keyword>FileUtils::StreamUtils</keyword>
  174.       <keyword>FileUtils::Verbose</keyword>
  175.       <keyword>FileUtils</keyword>
  176.       <keyword>Find</keyword>
  177.       <keyword>Fixnum</keyword>
  178.       <keyword>Float</keyword>
  179.       <keyword>FloatDomainError</keyword>
  180.       <keyword>Forwardable</keyword>
  181.       <keyword>GC</keyword>
  182.       <keyword>Generator</keyword>
  183.       <keyword>Hash</keyword>
  184.       <keyword>IO</keyword>
  185.       <keyword>IOError</keyword>
  186.       <keyword>Iconv::BrokenLibrary</keyword>
  187.       <keyword>Iconv::Failure</keyword>
  188.       <keyword>Iconv::IllegalSequence</keyword>
  189.       <keyword>Iconv::InvalidCharacter</keyword>
  190.       <keyword>Iconv::InvalidEncoding</keyword>
  191.       <keyword>Iconv::OutOfRange</keyword>
  192.       <keyword>Iconv</keyword>
  193.       <keyword>IndexError</keyword>
  194.       <keyword>Integer</keyword>
  195.       <keyword>Interrupt</keyword>
  196.       <keyword>Kernel</keyword>
  197.       <keyword>LoadError</keyword>
  198.       <keyword>LocalJumpError</keyword>
  199.       <keyword>Logger::Application</keyword>
  200.       <keyword>Logger::Error</keyword>
  201.       <keyword>Logger::Formatter</keyword>
  202.       <keyword>Logger::LogDevice::LogDeviceMutex</keyword>
  203.       <keyword>Logger::LogDevice</keyword>
  204.       <keyword>Logger::Severity</keyword>
  205.       <keyword>Logger::ShiftingError</keyword>
  206.       <keyword>Logger</keyword>
  207.       <keyword>Marshal</keyword>
  208.       <keyword>MatchData</keyword>
  209.       <keyword>Math</keyword>
  210.       <keyword>Matrix</keyword>
  211.       <keyword>Method</keyword>
  212.       <keyword>Module</keyword>
  213.       <keyword>Mutex</keyword>
  214.       <keyword>NameError::message</keyword>
  215.       <keyword>NameError</keyword>
  216.       <keyword>NilClass</keyword>
  217.       <keyword>NoMemoryError</keyword>
  218.       <keyword>NoMethodError</keyword>
  219.       <keyword>NotImplementedError</keyword>
  220.       <keyword>Numeric</keyword>
  221.       <keyword>Object</keyword>
  222.       <keyword>ObjectSpace</keyword>
  223.       <keyword>Observable</keyword>
  224.       <keyword>PStore::Error</keyword>
  225.       <keyword>PStore</keyword>
  226.       <keyword>Pathname</keyword>
  227.       <keyword>Precision</keyword>
  228.       <keyword>Proc</keyword>
  229.       <keyword>Process::GID</keyword>
  230.       <keyword>Process::Status</keyword>
  231.       <keyword>Process::Sys</keyword>
  232.       <keyword>Process::UID</keyword>
  233.       <keyword>Process</keyword>
  234.       <keyword>Queue</keyword>
  235.       <keyword>RUBY_PLATFORM</keyword>
  236.       <keyword>RUBY_RELEASE_DATE</keyword>
  237.       <keyword>RUBY_VERSION</keyword>
  238.       <keyword>Range</keyword>
  239.       <keyword>RangeError</keyword>
  240.       <keyword>Rational</keyword>
  241.       <keyword>Regexp</keyword>
  242.       <keyword>RegexpError</keyword>
  243.       <keyword>RuntimeError</keyword>
  244.       <keyword>STDERR</keyword>
  245.       <keyword>STDIN</keyword>
  246.       <keyword>STDOUT</keyword>
  247.       <keyword>ScriptError</keyword>
  248.       <keyword>SecurityError</keyword>
  249.       <keyword>Set</keyword>
  250.       <keyword>Shellwords</keyword>
  251.       <keyword>Signal</keyword>
  252.       <keyword>SignalException</keyword>
  253.       <keyword>SimpleDelegator</keyword>
  254.       <keyword>SingleForwardable</keyword>
  255.       <keyword>Singleton</keyword>
  256.       <keyword>SingletonClassMethods</keyword>
  257.       <keyword>SizedQueue</keyword>
  258.       <keyword>SortedSet</keyword>
  259.       <keyword>StandardError</keyword>
  260.       <keyword>String</keyword>
  261.       <keyword>StringIO</keyword>
  262.       <keyword>StringScanner::Error</keyword>
  263.       <keyword>StringScanner</keyword>
  264.       <keyword>Struct::Tms</keyword>
  265.       <keyword>Struct</keyword>
  266.       <keyword>Symbol</keyword>
  267.       <keyword>SyncEnumerator</keyword>
  268.       <keyword>SyntaxError</keyword>
  269.       <keyword>SystemCallError</keyword>
  270.       <keyword>SystemExit</keyword>
  271.       <keyword>SystemStackError</keyword>
  272.       <keyword>Tempfile</keyword>
  273.       <keyword>Test::Unit</keyword>
  274.       <keyword>Test</keyword>
  275.       <keyword>Thread</keyword>
  276.       <keyword>ThreadError</keyword>
  277.       <keyword>ThreadGroup</keyword>
  278.       <keyword>ThreadsWait</keyword>
  279.       <keyword>Time</keyword>
  280.       <keyword>Timeout::Error</keyword>
  281.       <keyword>Timeout</keyword>
  282.       <keyword>TrueClass</keyword>
  283.       <keyword>TypeError</keyword>
  284.       <keyword>URI::BadURIError</keyword>
  285.       <keyword>URI::Error</keyword>
  286.       <keyword>URI::Escape</keyword>
  287.       <keyword>URI::FTP</keyword>
  288.       <keyword>URI::Generic</keyword>
  289.       <keyword>URI::HTTP</keyword>
  290.       <keyword>URI::HTTPS</keyword>
  291.       <keyword>URI::InvalidComponentError</keyword>
  292.       <keyword>URI::InvalidURIError</keyword>
  293.       <keyword>URI::LDAP</keyword>
  294.       <keyword>URI::MailTo</keyword>
  295.       <keyword>URI::REGEXP::PATTERN</keyword>
  296.       <keyword>URI::REGEXP</keyword>
  297.       <keyword>URI</keyword>
  298.       <keyword>UnboundMethod</keyword>
  299.       <keyword>Vector</keyword>
  300.       <keyword>YAML</keyword>
  301.       <keyword>ZeroDivisionError</keyword>
  302.       <keyword>Zlib::BufError</keyword>
  303.       <keyword>Zlib::DataError</keyword>
  304.       <keyword>Zlib::Deflate</keyword>
  305.       <keyword>Zlib::Error</keyword>
  306.       <keyword>Zlib::GzipFile::CRCError</keyword>
  307.       <keyword>Zlib::GzipFile::Error</keyword>
  308.       <keyword>Zlib::GzipFile::LengthError</keyword>
  309.       <keyword>Zlib::GzipFile::NoFooter</keyword>
  310.       <keyword>Zlib::GzipFile</keyword>
  311.       <keyword>Zlib::GzipReader</keyword>
  312.       <keyword>Zlib::GzipWriter</keyword>
  313.       <keyword>Zlib::Inflate</keyword>
  314.       <keyword>Zlib::MemError</keyword>
  315.       <keyword>Zlib::NeedDict</keyword>
  316.       <keyword>Zlib::StreamEnd</keyword>
  317.       <keyword>Zlib::StreamError</keyword>
  318.       <keyword>Zlib::VersionError</keyword>
  319.       <keyword>Zlib::ZStream</keyword>
  320.       <keyword>Zlib</keyword>
  321.       <keyword>fatal</keyword>
  322.     </context>
  323.  
  324.     <context id="special-variables" style-ref="special-variable">
  325.       <keyword>self</keyword>
  326.       <keyword>super</keyword>
  327.       <keyword>__FILE__</keyword>
  328.       <keyword>__LINE__</keyword>
  329.     </context>
  330.  
  331.     <context id="predefined-variables" style-ref="predefined-variable">
  332.       <match extended="true">
  333.         \$([!$&"'*+,./0:;<=>?@\`~1-9]|
  334.            -[0FIKadilpvw]|
  335.            (deferr|defout|stderr|stdin|stdout|
  336.             DEBUG|FILENAME|KCODE|LOADED_FEATURES|LOAD_PATH|
  337.             PROGRAM_NAME|SAFE|VERBOSE)\b)
  338.       </match>
  339.     </context>
  340.  
  341.     <context id="global-variables" style-ref="variable">
  342.       <match>\$[a-zA-Z_][a-zA-Z0-9_]*</match>
  343.     </context>
  344.  
  345.     <context id="class-variables" style-ref="variable">
  346.       <match>@@[a-zA-Z_][a-zA-Z0-9_]*</match>
  347.     </context>
  348.  
  349.     <context id="instance-variables" style-ref="variable">
  350.       <match>@[a-zA-Z_][a-zA-Z0-9_]*</match>
  351.     </context>
  352.  
  353.     <context id="symbols" style-ref="symbol">
  354.       <match>(?<!:):[a-zA-Z0-9_]+</match>
  355.     </context>
  356.  
  357.     <context id="regexp-variables" style-ref="regex">
  358.       <match>\$[1-9][0-9]*</match>
  359.     </context>
  360.  
  361.     <context id="constants" style-ref="constant">
  362.       <match>(::)?\b[A-Z][A-Za-z0-9_]*\b</match>
  363.     </context>
  364.  
  365.     <context id="nil-value" style-ref="nil-value">
  366.       <keyword>NIL</keyword>
  367.       <keyword>nil</keyword>
  368.     </context>
  369.  
  370.     <context id="boolean" style-ref="boolean">
  371.       <keyword>FALSE</keyword>
  372.       <keyword>TRUE</keyword>
  373.       <keyword>false</keyword>
  374.       <keyword>true</keyword>
  375.     </context>
  376.  
  377.     <define-regex id="underscore_num">\d(_?\d)*</define-regex>
  378.  
  379.     <define-regex id="float" extended="true">
  380.       ( (\%{underscore_num})?\.\%{underscore_num} | \%{underscore_num}\. ) |
  381.       ( (\%{underscore_num}|(\%{underscore_num})?\.\%{underscore_num}|\%{underscore_num}\.)[eE][+-]?\%{underscore_num} )
  382.     </define-regex>
  383.  
  384.     <context id="float" style-ref="floating-point">
  385.       <match>(?<![\w\.])\%{float}(?![\w\.])</match>
  386.     </context>
  387.  
  388.     <context id="decimal" style-ref="decimal">
  389.       <match>(?<![\w\.])([1-9](_?[0-9])*|0)(?![\w\.])</match>
  390.     </context>
  391.  
  392.     <context id="hex" style-ref="base-n-integer">
  393.       <match>(?<![\w\.])0[xX][0-9A-Fa-f](_?[0-9A-Fa-f])*(?![\w\.])</match>
  394.     </context>
  395.  
  396.     <context id="octal" style-ref="base-n-integer">
  397.       <match>(?<![\w\.])0[0-7](_?[0-7])*(?![\w\.])</match>
  398.     </context>
  399.  
  400.     <context id="binary" style-ref="base-n-integer">
  401.       <match>(?<![\w\.])0[bB][01](_?[01])*(?![\w\.])</match>
  402.     </context>
  403.  
  404.     <context id="numeric-literal" style-ref="numeric-literal">
  405.       <match>(?<![\w\.])\?((\\[MC]-){1,2}|\\?)\S</match>
  406.     </context>
  407.  
  408.     <!-- in double quotes and backticks -->
  409.     <context id="simple-interpolation">
  410.       <start>#(?=[@$])</start> <!-- need assertion to not highlight single # -->
  411.       <end></end>
  412.       <include>
  413.         <context ref="class-variables"/>
  414.         <context ref="instance-variables"/>
  415.         <context ref="global-variables"/>
  416.       </include>
  417.     </context>
  418.  
  419.     <!-- in double quotes and backticks -->
  420.     <!-- FIXME: really would like for the syntax highlight to go back
  421.          to none here, as any ruby code could go here -->
  422.     <context id="complex-interpolation">
  423.       <start>#{</start>
  424.       <end>}</end>
  425.       <include>
  426.         <context ref="ruby:*"/>
  427.       </include>
  428.     </context>
  429.  
  430.     <!-- ruby strings do not end at line end,
  431.          so we cannot use def:string
  432.          (parts lifted from perl.lang) -->
  433.     <context id="double-quoted-string" style-ref="string">
  434.       <start>"</start>
  435.       <end>"</end>
  436.       <include>
  437.         <context ref="escape"/>
  438.         <context ref="def:line-continue"/>
  439.         <context ref="complex-interpolation"/>
  440.         <context ref="simple-interpolation"/>
  441.       </include>
  442.     </context>
  443.  
  444.     <context id="single-quoted-string" style-ref="string">
  445.       <start>'</start>
  446.       <end>'</end>
  447.       <include>
  448.         <context style-ref="escape">
  449.           <match>\\['\\]</match>
  450.         </context>
  451.       </include>
  452.     </context>
  453.  
  454.     <context id="backtick-quoted-string" style-ref="string">
  455.       <start>`</start>
  456.       <end>`</end>
  457.       <include>
  458.         <context ref="escape"/>
  459.         <context ref="def:line-continue"/>
  460.         <context ref="complex-interpolation"/>
  461.         <context ref="simple-interpolation"/>
  462.       </include>
  463.     </context>
  464.  
  465.     <context id="here-doc-string" style-ref="here-doc" style-inside="true">
  466.       <start><<(\w+)</start>
  467.       <end>^\%{1@start}</end>
  468.       <include>
  469.         <context ref="escape"/>
  470.         <context ref="def:line-continue"/>
  471.         <context ref="complex-interpolation"/>
  472.         <context ref="simple-interpolation"/>
  473.       </include>
  474.     </context>
  475.  
  476.     <context id="here-doc-indented-string" style-ref="here-doc" style-inside="true">
  477.       <start><<-(\w+)</start>
  478.       <end>^\s*\%{1@start}</end>
  479.       <include>
  480.         <context ref="escape"/>
  481.         <context ref="def:line-continue"/>
  482.         <context ref="complex-interpolation"/>
  483.         <context ref="simple-interpolation"/>
  484.       </include>
  485.     </context>
  486.  
  487.     <context id="here-doc-single-quoted-string" style-ref="here-doc" style-inside="true">
  488.       <start><<'(\w+)'</start>
  489.       <end>^\%{1@start}</end>
  490.       <include>
  491.         <context sub-pattern="0" where="start" style-ref="here-doc-bound"/>
  492.         <context sub-pattern="0" where="end" style-ref="here-doc-bound"/>
  493.       </include>
  494.     </context>
  495.  
  496.     <context id="here-doc-double-quoted-string" style-ref="here-doc" style-inside="true">
  497.       <start><<"(\w+)"</start>
  498.       <end>^\%{1@start}</end>
  499.       <include>
  500.         <context sub-pattern="0" where="start" style-ref="here-doc-bound"/>
  501.         <context sub-pattern="0" where="end" style-ref="here-doc-bound"/>
  502.         <context ref="escape"/>
  503.         <context ref="def:line-continue"/>
  504.         <context ref="complex-interpolation"/>
  505.         <context ref="simple-interpolation"/>
  506.       </include>
  507.     </context>
  508.  
  509.     <define-regex id="regex-opts">[iomx]*[neus]?[iomx]*</define-regex>
  510.  
  511.     <context id="regex-bracketed" style-ref="escape" style-inside="true">
  512.       <start>(?<!\\)[[]</start>
  513.       <end>(?<!\\)]</end>
  514.     </context>
  515.  
  516.     <context id="regex-alt-form" style-ref="regex">
  517.       <start>\%r\|</start>
  518.       <end>\|\%{regex-opts}</end>
  519.       <include>
  520.         <context ref="escape"/>
  521.         <context ref="def:line-continue"/>
  522.         <context ref="complex-interpolation"/>
  523.         <context ref="simple-interpolation"/>
  524.         <context ref="regex-bracketed"/>
  525.        </include>
  526.      </context>
  527.  
  528.     <context id="regex-simple" style-ref="regex">
  529.       <start extended="true">
  530.         ((?<=([(]|\s))|^)
  531.         \/
  532.         (?=
  533.           ([^/\\]*(\\.))*
  534.           [^/]*
  535.           \/
  536.           \%{regex-opts}
  537.           ([),;.]|\s|$)
  538.         )</start>
  539.       <end>\/\%{regex-opts}</end>
  540.       <include>
  541.         <context ref="escape"/>
  542.         <context ref="def:line-continue"/>
  543.         <context ref="complex-interpolation"/>
  544.         <context ref="simple-interpolation"/>
  545.         <context ref="regex-bracketed"/>
  546.       </include>
  547.     </context>
  548.  
  549.     <context id="ruby">
  550.       <include>
  551.         <context ref="def:shebang"/>
  552.         <context ref="def:shell-like-comment"/>
  553.         <context ref="multiline-comment"/>
  554.         <context ref="here-doc-single-quoted-string"/>
  555.         <context ref="here-doc-double-quoted-string"/>
  556.         <context ref="here-doc-string"/>
  557.         <context ref="here-doc-indented-string"/>
  558.         <context ref="double-quoted-string"/>
  559.         <context ref="single-quoted-string"/>
  560.         <context ref="backtick-quoted-string"/>
  561.         <context ref="attribute-definitions"/>
  562.         <context ref="definitions"/>
  563.         <context ref="module-handlers"/>
  564.         <context ref="keywords"/>
  565.         <context ref="builtins"/>
  566.         <context ref="special-variables"/>
  567.         <context ref="predefined-variables"/>
  568.         <context ref="global-variables"/>
  569.         <context ref="class-variables"/>
  570.         <context ref="instance-variables"/>
  571.         <context ref="symbols"/>
  572.         <context ref="regexp-variables"/>
  573.         <context ref="constants"/>
  574.         <context ref="nil-value"/>
  575.         <context ref="boolean"/>
  576.         <context ref="float"/>
  577.         <context ref="decimal"/>
  578.         <context ref="hex"/>
  579.         <context ref="octal"/>
  580.         <context ref="binary"/>
  581.         <context ref="numeric-literal"/>
  582.         <context ref="regex-alt-form"/>
  583.         <context ref="regex-simple"/>
  584.       </include>
  585.     </context>
  586.  
  587.   </definitions>
  588. </language>
  589.